<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>首页</title>
<script type="text/javascript">
	function logout() {
		var logout = document.getElementById("toLogin");
		logout.action="toLogin.do";
		logout.submit();
	}
</script>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/bootstrap/css/default.css">

<!-- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/carousel.css" > -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/style.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script
	src="${pageContext.request.contextPath}/css/bootstrap/js/bootstrap.min.js"></script>
<!-- <script src="${pageContext.request.contextPath}/js/common.js"></script> -->
</head>
<body>
<form id="toLogin">
	
</form>
	<nav class="navbar navbar-default" role="navigation">
	<div class="navbar-header">
		<button type="button" class="navbar-toggle" data-toggle="collapse"
			data-target="#bs-example-navbar-collapse-1">
			<span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span
				class="icon-bar"></span><span class="icon-bar"></span>
		</button>
		<a class="navbar-brand"
			href="${pageContext.request.contextPath}/index.action"><span
			class="logo">问卷</span> 调查</a>
	</div>

	<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
		<ul class="nav navbar-nav">
			<li class="active"><a
				href="${pageContext.request.contextPath}/home.jsp">首页</a></li>
			<li><a href="#">功能</a></li>
			<li><a href="#">应用</a></li>
			<li><a href="${pageContext.request.contextPath}/Question.jsp">调查</a></li>

		</ul>
		<c:if test="${sessionScope.userId == null}">
			<a href="${pageContext.request.contextPath}/register.jsp"><button class="btn btn-primary"
					style="float: right; height: 35px; width: 52px; margin: 5px">注册</button></a>
			<a href="${pageContext.request.contextPath}/login.jsp"><button
					class="btn btn-success"
					style="float: right; height: 35px; width: 52px; margin: 5px">登录</button></a>
		</c:if>

		<c:if test="${sessionScope.userId != null}">
			<!-- <form action="toLogin.do" method="post">
				<input class="toLogin"
					style="float: right; height: 35px; width: 60px; margin-top: 18px"
					type="submit">
			</form> -->
			<a href="javascript:;" onclick="logout()"
				style="float: right; height: 35px; width: 60px; margin-top: 18px; margin-right: 7px">退出登录
			</a>
			<a href="#"
				style="float: right; height: 35px; width: 60px; margin-top: 18px; margin-right: 7px">我的问卷
			</a>
			<a href="#"
				style="float: right; height: 35px; width: auto; margin-top: 18px; margin-right: 12px" id="session">${sessionScope.userId }
			</a>
			<input type="hidden" value="" id="id">
			<!-- 	<a href="#">退出登录</a> -->
		</c:if>


	</div>

	</nav>


</body>
</html>